<%@ page import="br.unicarioca.viaexpositus.Avaliacao" %>
<%@ page import="br.unicarioca.viaexpositus.TipoDeAvaliacao" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'avaliacao.label', default: 'Avaliacao')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        
        <div class="body">
            <div>
	            <h1><g:message code="Lista de Avalia&ccedil;&atilde;o" /></h1>
	            <div class="clear"></div>
	        </div>    
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'avaliacao.id.label', default: 'Id')}" />
                        
                            <th><g:message code="avaliacao.tipoDeAvaliacao.label" default="Tipo De Avalia&ccedil;&atilde;o" /></th>

                            <th><g:message code="avaliacao.dateCreated.label" default="Data De Avalia&ccedil;&atilde;o" /></th>
                   	    
                            <th><g:message code="avaliacao.relatorio.label" default="Relatorio" /></th>
                   	    
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${avaliacaoInstanceList}" status="i" var="avaliacaoInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td>${fieldValue(bean: avaliacaoInstance, field: "id")}</td>
                        
                            <td>${fieldValue(bean: avaliacaoInstance, field: "tipoDeAvaliacao")}</td>

                            <td> <g:formatDate format="dd/MM/yyyy" date="${avaliacaoInstance.dateCreated}" /> </td>

                            <g:if test="${''+avaliacaoInstance.tipoDeAvaliacao == ''+TipoDeAvaliacao.AVALIACAO_HUMANA}">
                                  <td> <a href="${createLink(controller:'relatorio' ,action:'showRelatorioHumano', id:avaliacaoInstance.relatorio.id)}">Relat&oacute;rio</a></td>
                            </g:if>
                            <g:if test="${''+avaliacaoInstance.tipoDeAvaliacao == ''+TipoDeAvaliacao.AVALIACAO_SOFTWARE}">
                                  <td> <a href="${createLink(controller:'relatorio' ,action:'showRelatorioAses', id:avaliacaoInstance.relatorio.id)}">Relat&oacute;rio</a></td>
                            </g:if>
                            
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${avaliacaoInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
